package com.ssh.service;

import java.util.List;

import com.ssh.dao.IAutoInfoDAO;
import com.ssh.model.AutoInfo;

public class AutoInfoService implements IAutoInfoService{
    private IAutoInfoDAO  autoInfoDAO;
	@Override
	public AutoInfo findAutoInfoById(long id) {
	    AutoInfo autoInfo=null;
	    try{
	    	autoInfo=autoInfoDAO.findAutoInfoById(id);
	    }catch(Exception e){
	    	e.printStackTrace();
	    }
	    return autoInfo;
	}

	@Override
	public void saveAutoInfo(AutoInfo autoInfo) {
		try{
			autoInfoDAO.saveAutoInfo(autoInfo);
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}
	@Override
	public List<AutoInfo> findAllAutoInfo() {
		List<AutoInfo> autos=null;
		try{
			autos=autoInfoDAO.findAllAutoInfo();
		}catch(Exception e){
			e.printStackTrace();
		}
		return autos;
	}
	public void setAutoInfoDAO(IAutoInfoDAO autoInfoDAO) {
		this.autoInfoDAO = autoInfoDAO;
	}

	public IAutoInfoDAO getAutoInfoDAO() {
		return autoInfoDAO;
	}



}
